home *** CD-ROM | disk | FTP | other *** search
- Path: naic.wpafb.af.mil!kda36
- From: kda36@naic.wpafb.af.mil (Keith D. Anthony - NAIC/TATA - 513-257-6351)
- Newsgroups: comp.lang.c
- Subject: E-mail from within a Program
- Date: 31 Jan 1996 19:09:34 GMT
- Organization: Wright Patterson AFB
- Distribution: world
- Message-ID: <4eoepe$kov@serveru1.naic.wpafb.af.mil>
- NNTP-Posting-Host: swtch91u.naic.wpafb.af.mil
-
-
- I'm attempting to write code that generates a file, probably
- in /tmp, e-mails this file to a userid, and does all this for
- a list of users.
-
- Have tried as a first attempt:
-
- char *arg1[7];
-
- arg1[0] = "mail";
- arg1[1] = "-s";
- arg1[2] = "test message";
- arg1[3] = "userid";
- arg1[4] = " < " /* have even tried \<*/
- arg1[5] = "/tmp/filename";
- arg1[6] = NULL;
-
- (sending to myself) I get a blank message and another one
- apparently going to "< userid".
-
- Do I need to manipulated some file descriptors?
- Anyone done something like this? Can anyone offer some code
- to e-mail files under program control (yes, in C).
-
- Oh yes, this is the generic C compiler under SUNOS 4.1.3.
-
- Thanks, and please e-mail any suggestions. I happily summarize
- and repost.
-